import http from '@/util/http.js'

/**
 * 预登录
 * @param params
 */
export function prelogin(params) {
  return http({
    url: '/kadmin/user/prelogin',
    method: 'post',
    data: params
  })
}

/**
 * 登录
 * @param params
 */
export function login(params) {
  return http({
    url: '/kadmin/user/login',
    method: 'post',
    data: params
  })
}

/**
 * 退出系统
 * @param params
 */
export function logout(params) {
  return http({
    url: '/kadmin/user/logout',
    method: 'post',
    data: params
  })
}

/**
 * 校验token
 * @param params
 */
export function validateToken(params) {
  return http({
    url: '/kadmin/user/validateToken',
    method: 'post',
    data: params
  })
}

/**
 * 分页查询用户
 * @param params
 */
export function getUserPage(params) {
  return http({
    url: '/kadmin/user/get_user_page',
    method: 'post',
    data: params
  })
}

/**
 * 修改密码
 * @param params
 */
export function modifyPwd(params) {
  return http({
    url: '/kadmin/user/modify_pwd',
    method: 'post',
    data: params
  })
}

/**
 * 查询用户详情
 * @param params
 */
export function getUser(params) {
  return http({
    url: '/kadmin/user/get_user',
    method: 'post',
    data: params
  })
}

/**
 * 修改用户详情
 * @param params
 */
export function modify(params) {
  return http({
    url: '/kadmin/user/modify',
    method: 'post',
    data: params
  })
}

/**
 * 更新个人信息
 * @param params
 */
export function updateMyInfo(params) {
  return http({
    url: '/kadmin/user/updateMyInfo',
    method: 'post',
    data: params
  })
}

/**
 * 新增用户
 * @param params
 */
export function add(params) {
  return http({
    url: '/kadmin/user/add',
    method: 'post',
    data: params
  })
}

/**
 * 关闭用户
 * @param params
 */
export function close(params) {
  return http({
    url: '/kadmin/user/close',
    method: 'post',
    data: params
  })
}

/**
 * 密码初始化
 * @param params
 */
export function resetPwd(params) {
  return http({
    url: '/kadmin/user/reset_pwd',
    method: 'post',
    data: params
  })
}
